//
//  GMExeTabHeadCell.m
//  Teecloud
//
//  Created by 小熊 on 2018/11/9.
//  Copyright © 2018年 小志. All rights reserved.
//

#import "GMExeTabHeadCell.h"
#import "GMSubjectsModel.h"
@interface GMExeTabHeadCell()
@property (weak, nonatomic) IBOutlet UILabel *titleName;
@end
@implementation GMExeTabHeadCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
-(void)setModel:(GMSubjectsModel *)model{
     _model = model;
    NSDictionary *options = @{NSDocumentTypeDocumentAttribute:NSHTMLTextDocumentType,NSFontAttributeName:@14};
    NSData * data = [model.Content dataUsingEncoding:NSUnicodeStringEncoding];
    NSMutableAttributedString *attri = [[NSMutableAttributedString alloc] initWithData:data options:options documentAttributes:nil error:nil];
    NSMutableParagraphStyle *style = [[NSMutableParagraphStyle alloc] init];
    style.lineSpacing=5;
    style.paragraphSpacing=2;
    [attri addAttribute:NSParagraphStyleAttributeName value:style range:NSMakeRange(0, attri.length)];
    self.titleName.attributedText = attri;
    CGRect rect = [self.titleName.attributedText boundingRectWithSize:CGSizeMake(DEVICE_WIDTH-30, 1000) options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading context:nil];
    model.titleHight =rect.size.height;

}

@end
